using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserControls_BrandListForCategory : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BrandsDropDownList1.DataSource = CatalogAccess.GetBrands();
            BrandsDropDownList1.DataBind();
            BrandsDropDownList1.Items.Insert(0, " - Sortuj po Producencie - ");
            
        }
    }

    protected void ChooseBrand(object sender, EventArgs e)
    {
        //BrandsDropDownList1.SelectedItem.Text = CatalogAccess.GetBrandDetails(Request.QueryString["BrandID"]).BrandName; 

        Response.Redirect(Request.ApplicationPath +
           "/Catalog.aspx?DepartmentID=" + Request.QueryString["DepartmentID"] + "&CategoryID=" + Request.QueryString["CategoryID"]
        +"&BrandID=" + BrandsDropDownList1.SelectedItem.Value);
    }

}
